from starlette.endpoints import HTTPEndpoint
from starlette.responses import JSONResponse
from database import Session, engine
import datetime
from dao import DaoWorkRecord



class SelectDetatilByMeterbarcode(HTTPEndpoint):

    async def get(self, request):
        session = Session()
        try:
           bureauid = request.query_params["bureauid"]
           meter_barcode = request.query_params["meter_barcode"]
           return  DaoWorkRecord.get_meter_info(session, bureauid, meter_barcode)
        finally:
            session.close()